﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Noria.Web.MyMSDN;
using Noria.Web.MyMSDN.Models;
using Noria.Web.MyMSDN.Workers;

namespace Noria.Web.Test
{
    [TestClass]
    public class MyMSDNWorkerTest
    {
        [TestMethod]
        public void MyMSDNWorkerUpload()
        {
            var worker = MyMSDNWorker.Create(new MockStatistics(), new AsyncWaiter()) as MyMSDNWorker;
            worker.Upload();
        }

        [TestMethod]
        public void TruncateDatabase()
        {
            // clear local database
            using (var db = new MmContext())
            {
                db.Database.ExecuteSqlCommand("truncate `checksum`");
                //db.Database.ExecuteSqlCommand("truncate `file`");
                //db.Database.ExecuteSqlCommand("truncate `family`");
                //db.Database.ExecuteSqlCommand("truncate `category`");
            }
        }

    }
}
